﻿
namespace NDI
{
    internal class ServiceEntry
    {
        public object Factory { get; set; }
        public object Instance { get; set; }
        /// <summary>
        /// 默认是第一个即Container
        /// </summary>
        public ReuseScope Scope { get; set; }
        public Container Container { get; set; }
        public Owner Owner { get; set; }

        public ServiceEntry CloneFor(Container container)
        {
            return new ServiceEntry()
            {
                Factory = Factory,
                Scope = Scope,
                Container = container,
                Owner = Owner,
                //这个地方不创建instance就是为了区别不同容器
            };
        }
    }
}
